Add rationales to rule documentation#3563
Merged
Merged
Conversation
fregante
reviewed
Jul 18, 2026
fregante
left a comment
Collaborator
There was a problem hiding this comment.
Sorry I didn't get a chance to read these before. They're good for the most part.
| <!-- end auto-generated rule header --> | ||
| <!-- Do not manually modify this header. Run: `npm run fix:eslint-docs` --> | ||
|
|
||
| Keeping empty braces together makes empty blocks and object literals easier to scan and avoids whitespace that has no meaning. |
Collaborator
There was a problem hiding this comment.
The style ones are a bit of a stretch. It's more like "I think it looks better" or "It's good to keep a consistent style"
|
|
||
| Improved version of the [`no-nested-ternary`](https://eslint.org/docs/latest/rules/no-nested-ternary) ESLint rule. This rule allows cases where the nested ternary is only one level and wrapped in parens. | ||
|
|
||
| Nested ternaries require readers to track multiple conditions and branches at once, making them harder to read and maintain. |
Collaborator
There was a problem hiding this comment.
By the way, I find nested ternaries acceptable at any depth, but only when they're if else if else, never if if else else. If properly formatted they're no different than actual if else if else blocks (wrap, no parens)
will open an issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.